//
//  WmcMediaTeamResourceModel.swift
//  YPWatermarkCamera
//
//  Created by 周诗松 on 2022/9/16.
//

import Foundation
import YPNetwork

class WmcMediaTeamResourceModel: YPNetworkJsonProtocol {
    class WmcMediaResourceModel: YPNetworkJsonProtocol,WmcPhotoModelProtocol {
        
        required init() {
            
        }
        
        var id: Int = 0

        var hm: String = ""
        var url: String = ""
        var resourceType: Int = 0
        var lat: Double = 0.0

        var lon: Double = 0.0
        
        /// 处理权限操作新增字段
        var memberId: Int = 0
    }

    required init() {
        
    }
    
    // Internal

    /// 成员id
    var uid: Int = 0

    var memberId: Int = 0

    var name: String = ""

    var avatar: String = ""

    var area: String = ""

    var date: String = ""

    var remark: String = ""
    
    var status: Bool = true
    
    var resources: [WmcMediaResourceModel] = []
    
    func getMember() -> WmcTeamMemberModel {
        let member = WmcTeamMemberModel.init()
        member.uid = self.uid
        member.name = self.name
        member.remark = self.remark
        member.memberId = memberId
        return member
    }
}

extension WmcMediaTeamResourceModel.WmcMediaResourceModel {
    
    func getTransformedModel() -> WmcMediaPhotoModel {
        
        let model = WmcMediaPhotoModel.init()
        model.id = self.id
        model.lat = self.lat
        model.lon = self.lon
        model.url = self.url
        model.takeTimeStr = self.hm
        model.resourceType = self.resourceType
        return model
    }
}
